import {defineComponent, onUnmounted, reactive, toRefs} from 'vue'
import Draw from './draw'

export default defineComponent({
  props: {
    category: {
      type: Array,// 引用类型的话,默认值要为函数返回值的形式!!! 1.String 2.Number 3.Boolean 4.Array 5.Object 6.Date 7.Function 8.Symbol
      require: true
    },
    series: {
      type: Array,// 引用类型的话,默认值要为函数返回值的形式!!! 1.String 2.Number 3.Boolean 4.Array 5.Object 6.Date 7.Function 8.Symbol
      require: true
    },
  },
  components: {
    Draw,
  },
  setup(props) {
    const  width = "320px"
    const  height = "330px"
    const { category,series } = toRefs(props)
    const  barCategory = category.value
    const  barSeries = series.value
    //console.log("bar")
   //console.log(barSeries)
    const cdata ={ category: barCategory, series: barSeries }
    return () => {
      return (
          <div>
            <Draw cdata={cdata} width={width} height={height}/>
          </div>
      )
    }
  },
})
